<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::Volume Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="class_sifteo_1_1_volume.html">Volume</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_sifteo_1_1_volume-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::Volume Class Reference<div class="ingroups"><a class="el" href="group__filesystem.html">Filesystem</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A coarse-grained region of external memory.  
 <a href="class_sifteo_1_1_volume.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="filesystem_8h_source.html">sifteo/filesystem.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a51e316c5824f5032be1ad59e90ed74ed"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a51e316c5824f5032be1ad59e90ed74ed">Type</a> { <a class="el" href="class_sifteo_1_1_volume.html#a51e316c5824f5032be1ad59e90ed74eda28ddc416b6e06b6b0bde07ad086a1dcc">T_GAME</a> = _SYS_FS_VOL_GAME, 
<a class="el" href="class_sifteo_1_1_volume.html#a51e316c5824f5032be1ad59e90ed74eda72f830363f366b2867f53ec199f9b76f">T_LAUNCHER</a> = _SYS_FS_VOL_LAUNCHER
 }</td></tr>
<tr class="memdesc:a51e316c5824f5032be1ad59e90ed74ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of common volume types.  <a href="class_sifteo_1_1_volume.html#a51e316c5824f5032be1ad59e90ed74ed">More...</a><br/></td></tr>
<tr class="separator:a51e316c5824f5032be1ad59e90ed74ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7ead230973e9c9c1a648221c4370fa7d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a7ead230973e9c9c1a648221c4370fa7d">exec</a> () const </td></tr>
<tr class="memdesc:a7ead230973e9c9c1a648221c4370fa7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transfer control to a new program.  <a href="#a7ead230973e9c9c1a648221c4370fa7d">More...</a><br/></td></tr>
<tr class="separator:a7ead230973e9c9c1a648221c4370fa7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35c5a031471bffc9629799d42f2f3ca0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a35c5a031471bffc9629799d42f2f3ca0"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a35c5a031471bffc9629799d42f2f3ca0">operator const _SYSVolumeHandle</a> () const </td></tr>
<tr class="memdesc:a35c5a031471bffc9629799d42f2f3ca0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implicit conversion to system object. <br/></td></tr>
<tr class="separator:a35c5a031471bffc9629799d42f2f3ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ec7c16798d9a55ac23165655defe1fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ec7c16798d9a55ac23165655defe1fd"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a3ec7c16798d9a55ac23165655defe1fd">operator!=</a> (_SYSVolumeHandle other) const </td></tr>
<tr class="memdesc:a3ec7c16798d9a55ac23165655defe1fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inequality comparison operator. <br/></td></tr>
<tr class="separator:a3ec7c16798d9a55ac23165655defe1fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcb69c6daf611e2ba2f8cc76120d49a7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abcb69c6daf611e2ba2f8cc76120d49a7"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#abcb69c6daf611e2ba2f8cc76120d49a7">operator==</a> (_SYSVolumeHandle other) const </td></tr>
<tr class="memdesc:abcb69c6daf611e2ba2f8cc76120d49a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equality comparison operator. <br/></td></tr>
<tr class="separator:abcb69c6daf611e2ba2f8cc76120d49a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d096f04faed26fdd7b85095b5c7d0d2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d096f04faed26fdd7b85095b5c7d0d2"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a3d096f04faed26fdd7b85095b5c7d0d2">Volume</a> ()</td></tr>
<tr class="memdesc:a3d096f04faed26fdd7b85095b5c7d0d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor, leaves the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> with an invalid value of zero. <br/></td></tr>
<tr class="separator:a3d096f04faed26fdd7b85095b5c7d0d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac43458f2bdd13e842d80903a63b2c72b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac43458f2bdd13e842d80903a63b2c72b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#ac43458f2bdd13e842d80903a63b2c72b">Volume</a> (_SYSVolumeHandle vh)</td></tr>
<tr class="memdesc:ac43458f2bdd13e842d80903a63b2c72b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize from a system object. <br/></td></tr>
<tr class="separator:ac43458f2bdd13e842d80903a63b2c72b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:abbb04f118cdb4bf99ee83857e42478b5"><td class="memTemplParams" colspan="2">template&lt;unsigned T&gt; </td></tr>
<tr class="memitem:abbb04f118cdb4bf99ee83857e42478b5"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#abbb04f118cdb4bf99ee83857e42478b5">list</a> (unsigned volType, <a class="el" href="class_sifteo_1_1_array.html">Array</a>&lt; <a class="el" href="class_sifteo_1_1_volume.html">Volume</a>, T &gt; &amp;volumes)</td></tr>
<tr class="memdesc:abbb04f118cdb4bf99ee83857e42478b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">List all volumes of the specified type.  <a href="#abbb04f118cdb4bf99ee83857e42478b5">More...</a><br/></td></tr>
<tr class="separator:abbb04f118cdb4bf99ee83857e42478b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ccabba03051680ccf2019f78c1aff16"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_sifteo_1_1_volume.html">Volume</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a9ccabba03051680ccf2019f78c1aff16">previous</a> ()</td></tr>
<tr class="memdesc:a9ccabba03051680ccf2019f78c1aff16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> corresponding to the previously running program.  <a href="#a9ccabba03051680ccf2019f78c1aff16">More...</a><br/></td></tr>
<tr class="separator:a9ccabba03051680ccf2019f78c1aff16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ee1e9d602e936bb56137e85a93c64a4"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_sifteo_1_1_volume.html">Volume</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_volume.html#a6ee1e9d602e936bb56137e85a93c64a4">running</a> ()</td></tr>
<tr class="memdesc:a6ee1e9d602e936bb56137e85a93c64a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> corresponding to the currently running program.  <a href="#a6ee1e9d602e936bb56137e85a93c64a4">More...</a><br/></td></tr>
<tr class="separator:a6ee1e9d602e936bb56137e85a93c64a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A coarse-grained region of external memory. </p>
<p>Volumes are used by the operating system for various purposes, including storing games.</p>
<p>Typical games will not need <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> objects. They are only useful if you need to launch or retrieve data from other programs or other bundles of data which were installed separately from your game. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a51e316c5824f5032be1ad59e90ed74ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_sifteo_1_1_volume.html#a51e316c5824f5032be1ad59e90ed74ed">Sifteo::Volume::Type</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enumeration of common volume types. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a51e316c5824f5032be1ad59e90ed74eda28ddc416b6e06b6b0bde07ad086a1dcc"></a>T_GAME</em>&nbsp;</td><td class="fielddoc">
<p><a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> type for normal games. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a51e316c5824f5032be1ad59e90ed74eda72f830363f366b2867f53ec199f9b76f"></a>T_LAUNCHER</em>&nbsp;</td><td class="fielddoc">
<p><a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> type for the system launcher. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7ead230973e9c9c1a648221c4370fa7d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::Volume::exec </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Transfer control to a new program. </p>
<p>Fully replaces the current program in memory. Does not return. For Volumes containing a valid ELF binary only.</p>
<p>This does <em>not</em> automatically call <a class="el" href="class_sifteo_1_1_system.html#a551bacdfb105214464f619940af15956" title="Set the range of cubes supported.">System::setCubeRange()</a> on behalf of the new program, nor does it load any bootstrap assets. Both of these tasks are typically done by the Launcher app, before calling <a class="el" href="class_sifteo_1_1_volume.html#a7ead230973e9c9c1a648221c4370fa7d" title="Transfer control to a new program.">exec()</a>, by reading the volume metadata with <a class="el" href="class_sifteo_1_1_mapped_volume.html#aa996a30a54f8ad245c0299c00a1e2152" title="Look up a metadata value from the mapped Volume.">MappedVolume::metadata()</a>.</p>
<dl class="section warning"><dt>Warning</dt><dd>While it is possible to call Volume::current().<a class="el" href="class_sifteo_1_1_volume.html#a7ead230973e9c9c1a648221c4370fa7d" title="Transfer control to a new program.">exec()</a> to restart the current program, there is an edge case to be aware of: Programs may be deleted or upgraded while they are running, in which case Volume::current() refers to a volume which has been deleted. Deleted volumes will not be recycled as long as they are mapped, so programs normally continue running correctly in this case. But a deleted volume cannot be executed or mapped. If this edge case is important to avoid, one approach would be to search for the new version of your own application, if any, using <a class="el" href="class_sifteo_1_1_volume.html#abbb04f118cdb4bf99ee83857e42478b5" title="List all volumes of the specified type.">Volume::list()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="abbb04f118cdb4bf99ee83857e42478b5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void Sifteo::Volume::list </td>
          <td>(</td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>volType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_sifteo_1_1_array.html">Array</a>&lt; <a class="el" href="class_sifteo_1_1_volume.html">Volume</a>, T &gt; &amp;&#160;</td>
          <td class="paramname"><em>volumes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>List all volumes of the specified type. </p>
<p>Populates an <a class="el" href="class_sifteo_1_1_array.html" title="A statically sized array.">Array</a> with the results. </p>

</div>
</div>
<a class="anchor" id="a9ccabba03051680ccf2019f78c1aff16"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_sifteo_1_1_volume.html">Volume</a> Sifteo::Volume::previous </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> corresponding to the previously running program. </p>
<p>This refers to the program that was running before the last <a class="el" href="class_sifteo_1_1_volume.html#a7ead230973e9c9c1a648221c4370fa7d" title="Transfer control to a new program.">exec()</a>. For normal games, this will always be the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> associated with the system launcher.</p>
<p>If there was no previously running program (the system booted directly into the current <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a>) this returns a volume with the invalid value of zero. </p>

</div>
</div>
<a class="anchor" id="a6ee1e9d602e936bb56137e85a93c64a4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_sifteo_1_1_volume.html">Volume</a> Sifteo::Volume::running </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the <a class="el" href="class_sifteo_1_1_volume.html" title="A coarse-grained region of external memory.">Volume</a> corresponding to the currently running program. </p>
<p>This can be used in various ways, such as skipping the current game in a listing of other games, reading your own metadata, or accessing saved objects that belong to you. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="filesystem_8h_source.html">filesystem.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
